import { NgModule }             from '@angular/core';
import { RouterModule, Routes, Router } from '@angular/router';

import { WorkSpaceComponent } from './work-space.component';

const workSpaceRoutes =[
  {
    path: '',
    component: WorkSpaceComponent,
    children: [
      { path:'', redirectTo: 'user', pathMatch: 'full' },
      { path: 'user', loadChildren: '../user/user.module#UserModule'},
      { path: 'sys', loadChildren: '../sys/sys.module#SysModule'}
    ]
  }
];

@NgModule({
  imports: [
    RouterModule.forChild(workSpaceRoutes)
  ],
  exports: [
    RouterModule
  ]
})

export class WorkSpaceRoutingModule {
  // Diagnostic only: inspect router configuration
  constructor(router: Router) {
    console.log('Routes: ', JSON.stringify(router.config, undefined, 2));
  }
}
